#pragma once

#include <qwt_array.h> //en fait c'est des <qvector.h>
#include <qwt_plot.h>


////////////////////////////////////////////////////////////////////////////////////////////////////
/// \class	SPlotCurveData
///
/// \brief	(PRIVATE) define an object that contained the data for on curve.
///
/// \author	Sylvain Martin
/// \date	2/4/2011
///
/// \remark order to use Qwt as a dll and inherit a QWT object we must define the macro in the
/// 		preprocessor QWT_DLL. in , the project need a preprocessor define
/// 		[configuration properties]->[c/c++]->[preprocessor]->[preprocessor definitions]-> QWT_DLL
/// 		(and leave the rest as it is)
///
/// inspired from the "real time" example of Qwt
/// it is a private class, do not use it directly !
////////////////////////////////////////////////////////////////////////////////////////////////////
class SPlotCurveData
{
	// A container class for growing data
public:

	SPlotCurveData();

	void append(double *x, double *y, int count);
	void append(double x, double y);

	int count() const;
	int size() const;
	const double *x() const;
	const double *y() const;

	Q_INVOKABLE bool overbook() const;
	Q_INVOKABLE void setOverbook(bool val);

private:
	int d_count;
	QwtArray<double> d_x;
	QwtArray<double> d_y;

	bool overbook_; // if true, reserve more memory while reallocating memory for the 
	// AddPoint function (process is accelerated because there is no reallocated each time)
};